//
//  NXMHomeViewController.swift
//  AnneKit-Swift
//
//  Created by 宁小陌 on 2021/2/3.
//  Copyright © 2021 宁小陌. All rights reserved.
//

import UIKit
import SwiftyJSON

class NXMHomeViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        NXMUILog(parameter: kStatusBarHeight)
        self.view.backgroundColor = UIColor.kViewColorNormal
        if isIphoneX() {
            NXMUILog(parameter: "isIphoneX")
        }else{
            NXMUILog(parameter: "isIphoneX个锤子")
        }
        
        NXMUILog(parameter: nxm_getCurrentStingTime())
//        jsonFromData()
    }

//    func jsonFromData() {
//        if let file = Bundle.main.path(forResource: "test_model", ofType: "json") {
//            do {
//                let data = try Data(contentsOf: URL(fileURLWithPath: file))
//                let json = try JSON(data: data)
//
//                NXMUILog(parameter: json)
//                //转成JSON对象
//                let jsonData = JSON.init(data)
//
//                let model = XMTestModel(jsonData: jsonData)
//
////                viewController.json = json
//                //从JSON Dictionary中获取key为ResultCode的int值
//                let resultCode = json["code"].int!
//                print("ResultCode:\(resultCode)")
//                let array = json["list"]
//
//                NXMUILog(parameter: model.code)
//                NXMUILog(parameter: model.list[0])
//                NXMUILog(parameter: model.detail_address.city)
//                //从JSON Array中进行循环解析
//                for (index,subJson):(String,JSON) in array {
//
//                    let IDx = subJson["idx"].string!
//                    let userId = subJson["userID"].stringValue
//                    let content = subJson["content"].string!
//                    let date = subJson["date"].string!
//
//                    print("\(index)---\(IDx):\(userId) will do \(content) at \(date)")
//                }
//            } catch {
////                viewController.json = JSON.null
//            }
//        } else {
////            viewController.json = JSON.null
//        }
//    }
    
    func jsonlist(){
        
    }
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        let vc = XMWebViewController()
        vc.hidesBottomBarWhenPushed = true
        self.navigationController?.pushViewController(vc, animated: true)
    }
}
